﻿<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><meta http-equiv="Content-Style-Type" content="text/css" /><meta name="generator" content="Aspose.Words for .NET 15.1.0.0" /><title></title></head><body><div><h1 style="font-size:22pt; line-height:130%; margin:13pt 0pt; orphans:0; page-break-after:avoid; page-break-inside:avoid; text-align:center; text-indent:0pt; widows:0"><span style="font-family:微软雅黑; font-size:22pt; font-weight:bold">第</span><span style="font-family:Consolas; font-size:22pt; font-weight:bold">2</span><span style="font-family:微软雅黑; font-size:22pt; font-weight:bold">章</span><span style="font:7.0pt 'Times New Roman'">&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0; </span><span style="font-family:Consolas; font-size:22pt; font-weight:bold">API</span><span style="font-family:微软雅黑; font-size:22pt; font-weight:bold">管理服务器搭建</span></h1><h1 style="font-size:22pt; line-height:130%; margin:13pt 0pt; orphans:0; page-break-after:avoid; page-break-inside:avoid; text-align:justify; text-indent:0pt; widows:0"><span style="font-family:Consolas; font-size:22pt; font-weight:bold">1</span><span style="font-family:微软雅黑; font-size:22pt; font-weight:bold">、</span><span style="font-family:Consolas; font-size:22pt; font-weight:bold">API </span><span style="font-family:微软雅黑; font-size:22pt; font-weight:bold">简介</span></h1><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; text-indent:21pt; widows:0"><span style="font-family:微软雅黑; font-size:10.5pt">网络应用程序，分为前端和后端两个部分。当前的发展趋势，就是前端设备层出不穷（手机、平板、桌面电脑、其他专用设备</span><span style="font-family:Consolas; font-size:10.5pt">......</span><span style="font-family:微软雅黑; font-size:10.5pt">）。</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; text-indent:21pt; widows:0"><span style="font-family:微软雅黑; font-size:10.5pt">因此，必须有一种统一的机制，方便不同的前端设备与后端进行通信。而</span><span style="font-family:Consolas; font-size:10.5pt">API</span><span style="font-family:微软雅黑; font-size:10.5pt">就是完成和前端和后端的交互的地方。这导致</span><span style="font-family:Consolas; font-size:10.5pt">API</span><span style="font-family:微软雅黑; font-size:10.5pt">构架的流行，甚至出现</span><span style="font-family:Consolas; font-size:10.5pt">"API First"</span><span style="font-family:微软雅黑; font-size:10.5pt">的设计思想。</span><span style="font-family:Consolas; font-size:10.5pt">API</span><span style="font-family:微软雅黑; font-size:10.5pt">协议就是前端和后端完成交互时所遵循的规则。目前，</span><span style="font-family:Consolas; font-size:10.5pt">RESTful API</span><span style="font-family:微软雅黑; font-size:10.5pt">是比较成熟的一套互联网应用程序的</span><span style="font-family:Consolas; font-size:10.5pt">API</span><span style="font-family:微软雅黑; font-size:10.5pt">设计理论。</span></p><h2 style="font-size:16pt; line-height:130%; margin:13pt 0pt; orphans:0; page-break-after:avoid; page-break-inside:avoid; text-align:justify; text-indent:0pt; widows:0"><span style="font-family:Consolas; font-size:16pt; font-weight:bold">1.1</span><span style="font:7.0pt 'Times New Roman'">&#xa0;&#xa0;&#xa0;&#xa0;&#xa0; </span><span style="font-family:Consolas; font-size:16pt; font-weight:bold">API</span><span style="font-family:微软雅黑; font-size:16pt; font-weight:bold">接口 组成</span></h2><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt 21pt; orphans:0; text-align:justify; text-indent:-21pt; widows:0"><span style="font-family:Wingdings; font-size:10.5pt"></span><span style="font:7.0pt 'Times New Roman'">&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0; </span><span style="font-family:微软雅黑; font-size:10.5pt">接口描述</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><span style="font-family:微软雅黑; font-size:10.5pt">这个接口是用来干嘛的，以及相关的规则</span><span style="font-family:微软雅黑; font-size:10.5pt">。</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt 21pt; orphans:0; text-align:justify; text-indent:-21pt; widows:0"><span style="font-family:Wingdings; font-size:10.5pt"></span><span style="font:7.0pt 'Times New Roman'">&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0; </span><span style="font-family:微软雅黑; font-size:10.5pt">接口地址：</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><span style="font-family:微软雅黑; font-size:10.5pt">以网址的形式展现，你通过发送请求给这个网址来对接口进行交互操作</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt 21pt; orphans:0; text-align:justify; text-indent:-21pt; widows:0"><span style="font-family:Wingdings; font-size:10.5pt"></span><span style="font:7.0pt 'Times New Roman'">&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0; </span><span style="font-family:微软雅黑; font-size:10.5pt">请求方法：</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; text-indent:10.5pt; widows:0"><span style="font-family:微软雅黑; font-size:10.5pt">常用的有</span><span style="font-family:Consolas; font-size:10.5pt">GET/POST/DELETE/PUT</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt 21pt; orphans:0; text-align:justify; text-indent:-21pt; widows:0"><span style="font-family:Wingdings; font-size:10.5pt"></span><span style="font:7.0pt 'Times New Roman'">&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0; </span><span style="font-family:微软雅黑; font-size:10.5pt">请求参数：</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><span style="font-family:微软雅黑; font-size:10.5pt">请求该接口时，需要提供的参数，参数属性包括名称、类型、是否必填、描述等</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt 21pt; orphans:0; text-align:justify; text-indent:-21pt; widows:0"><span style="font-family:Wingdings; font-size:10.5pt"></span><span style="font:7.0pt 'Times New Roman'">&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0; </span><span style="font-family:微软雅黑; font-size:10.5pt">返回参数：</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><span style="font-family:微软雅黑; font-size:10.5pt">接口正常响应后，返回的内容</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt 21pt; orphans:0; text-align:justify; text-indent:-21pt; widows:0"><span style="font-family:Wingdings; font-size:10.5pt"></span><span style="font:7.0pt 'Times New Roman'">&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0; </span><span style="font-family:微软雅黑; font-size:10.5pt">错误代码：</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><span style="font-family:微软雅黑; font-size:10.5pt">接口请求失败后，返回的错误代码</span></p><h2 style="font-size:16pt; line-height:130%; margin:13pt 0pt; orphans:0; page-break-after:avoid; page-break-inside:avoid; text-align:justify; text-indent:0pt; widows:0"><span style="font-family:Consolas; font-size:16pt; font-weight:bold">1.2</span><span style="font:7.0pt 'Times New Roman'">&#xa0;&#xa0;&#xa0;&#xa0;&#xa0; </span><span style="font-family:Consolas; font-size:16pt; font-weight:bold">RestfulApi</span><span style="font-family:微软雅黑; font-size:16pt; font-weight:bold">的组成</span></h2><h3 style="margin:13pt 0pt; orphans:0; page-break-after:avoid; page-break-inside:avoid; text-align:justify; widows:0"><span style="font-family:Consolas; font-size:16pt; font-weight:bold">1.2.1 </span><span style="font-family:微软雅黑; font-size:16pt; font-weight:bold">通信协议</span></h3><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><span style="font-family:Consolas; font-size:10.5pt">API</span><span style="font-family:微软雅黑; font-size:10.5pt">与用户的通信协议，总是使用</span><span style="font-family:Consolas; font-size:10.5pt">HTTPs</span><span style="font-family:微软雅黑; font-size:10.5pt">协议。</span></p><h3 style="margin:13pt 0pt; orphans:0; page-break-after:avoid; page-break-inside:avoid; text-align:justify; widows:0"><span style="font-family:Consolas; font-size:16pt; font-weight:bold">1.2.2 </span><span style="font-family:微软雅黑; font-size:16pt; font-weight:bold">域名</span></h3><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><span style="font-family:微软雅黑; font-size:10.5pt">应该尽量将</span><span style="font-family:Consolas; font-size:10.5pt">API</span><span style="font-family:微软雅黑; font-size:10.5pt">部署在专用域名之下。</span></p><table cellspacing="0" cellpadding="0" style="border-collapse:collapse; margin-left:0pt"><tr><td style="border-bottom-color:#000000; border-bottom-style:solid; border-bottom-width:0.75pt; border-left-color:#000000; border-left-style:solid; border-left-width:0.75pt; border-right-color:#000000; border-right-style:solid; border-right-width:0.75pt; border-top-color:#000000; border-top-style:solid; border-top-width:0.75pt; padding-left:5.03pt; padding-right:5.03pt; vertical-align:top; width:415.3pt"><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><span style="font-family:Consolas; font-size:10.5pt; vertical-align:baseline">https://api.</span><span style="font-family:Consolas; font-size:10.5pt; vertical-align:baseline">bjsxt</span><span style="font-family:Consolas; font-size:10.5pt; vertical-align:baseline">.com</span></p></td></tr></table><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><span style="font-family:微软雅黑; font-size:10.5pt">如果确定</span><span style="font-family:Consolas; font-size:10.5pt">API</span><span style="font-family:微软雅黑; font-size:10.5pt">很简单，不会有进一步扩展，可以考虑放在主域名下</span><span style="font-family:Consolas; font-size:10.5pt">:</span></p><table cellspacing="0" cellpadding="0" style="border-collapse:collapse; margin-left:0pt"><tr><td style="border-bottom-color:#000000; border-bottom-style:solid; border-bottom-width:0.75pt; border-left-color:#000000; border-left-style:solid; border-left-width:0.75pt; border-right-color:#000000; border-right-style:solid; border-right-width:0.75pt; border-top-color:#000000; border-top-style:solid; border-top-width:0.75pt; padding-left:5.03pt; padding-right:5.03pt; vertical-align:top; width:415.3pt"><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><span style="font-family:Consolas; font-size:10.5pt; vertical-align:baseline">https://</span><span style="font-family:Consolas; font-size:10.5pt; vertical-align:baseline">bjsxt</span><span style="font-family:Consolas; font-size:10.5pt; vertical-align:baseline">.</span><span style="font-family:Consolas; font-size:10.5pt; vertical-align:baseline">com</span><span style="font-family:Consolas; font-size:10.5pt; vertical-align:baseline">/api/</span></p></td></tr></table><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; text-indent:21pt; widows:0"><span style="font-family:Consolas; font-size:10.5pt">&#xa0;</span></p><h3 style="margin:13pt 0pt; orphans:0; page-break-after:avoid; page-break-inside:avoid; text-align:justify; widows:0"><span style="font-family:Consolas; font-size:16pt; font-weight:bold">1.2.3</span><span style="font-family:微软雅黑; font-size:16pt; font-weight:bold">版本</span></h3><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><span style="font-family:微软雅黑; font-size:10.5pt">应该将</span><span style="font-family:Consolas; font-size:10.5pt">API</span><span style="font-family:微软雅黑; font-size:10.5pt">的版本号放入</span><span style="font-family:Consolas; font-size:10.5pt">URL</span><span style="font-family:微软雅黑; font-size:10.5pt">。</span></p><table cellspacing="0" cellpadding="0" style="border-collapse:collapse; margin-left:0pt"><tr><td style="border-bottom-color:#000000; border-bottom-style:solid; border-bottom-width:0.75pt; border-left-color:#000000; border-left-style:solid; border-left-width:0.75pt; border-right-color:#000000; border-right-style:solid; border-right-width:0.75pt; border-top-color:#000000; border-top-style:solid; border-top-width:0.75pt; padding-left:5.03pt; padding-right:5.03pt; vertical-align:top; width:415.3pt"><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><span style="font-family:Consolas; font-size:10.5pt; vertical-align:baseline">https://api.</span><span style="font-family:Consolas; font-size:10.5pt; vertical-align:baseline">bjsxt</span><span style="font-family:Consolas; font-size:10.5pt; vertical-align:baseline">.com/v1/</span></p></td></tr></table><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><span style="font-family:微软雅黑; font-size:10.5pt">另一种做法是，将版本号放在</span><span style="font-family:Consolas; font-size:10.5pt">HTTP</span><span style="font-family:微软雅黑; font-size:10.5pt">头信息中，但不如放入</span><span style="font-family:Consolas; font-size:10.5pt">URL</span><span style="font-family:微软雅黑; font-size:10.5pt">方便和直观。</span><span style="font-family:Consolas; font-size:10.5pt">Github</span><span style="font-family:微软雅黑; font-size:10.5pt">采用这种做法。</span></p><h3 style="margin:13pt 0pt; orphans:0; page-break-after:avoid; page-break-inside:avoid; text-align:justify; widows:0"><span style="font-family:Consolas; font-size:16pt; font-weight:bold">1.2.4 </span><span style="font-family:微软雅黑; font-size:16pt; font-weight:bold">路径</span><span style="font-family:Consolas; font-size:16pt; font-weight:bold">(Endpoint)</span></h3><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><span style="font-family:微软雅黑; font-size:10.5pt">路径又称</span><span style="font-family:Consolas; font-size:10.5pt">"</span><span style="font-family:微软雅黑; font-size:10.5pt">终点</span><span style="font-family:Consolas; font-size:10.5pt">"</span><span style="font-family:微软雅黑; font-size:10.5pt">（</span><span style="font-family:Consolas; font-size:10.5pt">endpoint</span><span style="font-family:微软雅黑; font-size:10.5pt">），表示</span><span style="font-family:Consolas; font-size:10.5pt">API</span><span style="font-family:微软雅黑; font-size:10.5pt">的具体网址。</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><span style="font-family:微软雅黑; font-size:10.5pt">在</span><span style="font-family:Consolas; font-size:10.5pt">RESTful</span><span style="font-family:微软雅黑; font-size:10.5pt">架构中，每个网址代表一种资源（</span><span style="font-family:Consolas; font-size:10.5pt">resource</span><span style="font-family:微软雅黑; font-size:10.5pt">），所以网址中不能有动词，只能有名词，而且所用的名词往往与数据库的表格名对应。一般来说，数据库中的表都是同种记录的</span><span style="font-family:Consolas; font-size:10.5pt">"</span><span style="font-family:微软雅黑; font-size:10.5pt">集合</span><span style="font-family:Consolas; font-size:10.5pt">"</span><span style="font-family:微软雅黑; font-size:10.5pt">（</span><span style="font-family:Consolas; font-size:10.5pt">collection</span><span style="font-family:微软雅黑; font-size:10.5pt">），所以</span><span style="font-family:Consolas; font-size:10.5pt">API</span><span style="font-family:微软雅黑; font-size:10.5pt">中的名词也应该使用复数。</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; text-indent:21pt; widows:0"><span style="font-family:微软雅黑; font-size:10.5pt">举例来说，有一个</span><span style="font-family:Consolas; font-size:10.5pt">API</span><span style="font-family:微软雅黑; font-size:10.5pt">提供学院（</span><span style="font-family:Consolas; font-size:10.5pt">academy</span><span style="font-family:微软雅黑; font-size:10.5pt">）的信息，还包括各种学生和老师的信息，则它的路径应该设计成下面这样。</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt 21pt; orphans:0; text-align:justify; text-indent:-21pt; widows:0"><span style="font-family:Wingdings; font-size:10.5pt"></span><span style="font:7.0pt 'Times New Roman'">&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0; </span><span style="font-family:Consolas; font-size:10.5pt; vertical-align:baseline">https://api.bjsxt.com/v1/academies</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt 21pt; orphans:0; text-align:justify; text-indent:-21pt; widows:0"><span style="font-family:Wingdings; font-size:10.5pt"></span><span style="font:7.0pt 'Times New Roman'">&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0; </span><span style="font-family:Consolas; font-size:10.5pt; vertical-align:baseline">https://api.bjsxt.com/v1/students</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt 21pt; orphans:0; text-align:justify; text-indent:-21pt; widows:0"><span style="font-family:Wingdings; font-size:10.5pt"></span><span style="font:7.0pt 'Times New Roman'">&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0; </span><span style="font-family:Consolas; font-size:10.5pt; vertical-align:baseline">https://api.bjsxt.com/v1/teachers</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; text-indent:21pt; widows:0"><span style="font-family:Consolas; font-size:10.5pt">&#xa0;</span></p><h3 style="margin:13pt 0pt; orphans:0; page-break-after:avoid; page-break-inside:avoid; text-align:justify; widows:0"><span style="font-family:Consolas; font-size:16pt; font-weight:bold">1.2.5 HTTP</span><span style="font-family:微软雅黑; font-size:16pt; font-weight:bold">动词</span></h3><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><span style="font-family:微软雅黑; font-size:10.5pt">对于资源的具体操作类型，由</span><span style="font-family:Consolas; font-size:10.5pt">HTTP</span><span style="font-family:微软雅黑; font-size:10.5pt">动词表示。</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><span style="font-family:微软雅黑; font-size:10.5pt">常用的</span><span style="font-family:Consolas; font-size:10.5pt">HTTP</span><span style="font-family:微软雅黑; font-size:10.5pt">动词有下面五个（括号里是对应的</span><span style="font-family:Consolas; font-size:10.5pt">SQL</span><span style="font-family:微软雅黑; font-size:10.5pt">命令）。</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt 21pt; orphans:0; text-align:justify; text-indent:-21pt; widows:0"><span style="font-family:Wingdings; font-size:10.5pt"></span><span style="font:7.0pt 'Times New Roman'">&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0; </span><span style="font-family:Consolas; font-size:10.5pt">GET</span><span style="font-family:微软雅黑; font-size:10.5pt">（</span><span style="font-family:Consolas; font-size:10.5pt">SELECT</span><span style="font-family:微软雅黑; font-size:10.5pt">）：从服务器取出资源（一项或多项）。</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt 21pt; orphans:0; text-align:justify; text-indent:-21pt; widows:0"><span style="font-family:Wingdings; font-size:10.5pt"></span><span style="font:7.0pt 'Times New Roman'">&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0; </span><span style="font-family:Consolas; font-size:10.5pt">POST</span><span style="font-family:微软雅黑; font-size:10.5pt">（</span><span style="font-family:Consolas; font-size:10.5pt">CREATE</span><span style="font-family:微软雅黑; font-size:10.5pt">）：在服务器新建一个资源。</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt 21pt; orphans:0; text-align:justify; text-indent:-21pt; widows:0"><span style="font-family:Wingdings; font-size:10.5pt"></span><span style="font:7.0pt 'Times New Roman'">&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0; </span><span style="font-family:Consolas; font-size:10.5pt">PUT</span><span style="font-family:微软雅黑; font-size:10.5pt">（</span><span style="font-family:Consolas; font-size:10.5pt">UPDATE</span><span style="font-family:微软雅黑; font-size:10.5pt">）：在服务器更新资源（客户端提供改变后的完整资源）。</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt 21pt; orphans:0; text-align:justify; text-indent:-21pt; widows:0"><span style="font-family:Wingdings; font-size:10.5pt"></span><span style="font:7.0pt 'Times New Roman'">&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0; </span><span style="font-family:Consolas; font-size:10.5pt">PATCH</span><span style="font-family:微软雅黑; font-size:10.5pt">（</span><span style="font-family:Consolas; font-size:10.5pt">UPDATE</span><span style="font-family:微软雅黑; font-size:10.5pt">）：在服务器更新资源（客户端提供改变的属性）。</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt 21pt; orphans:0; text-align:justify; text-indent:-21pt; widows:0"><span style="font-family:Wingdings; font-size:10.5pt"></span><span style="font:7.0pt 'Times New Roman'">&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0; </span><span style="font-family:Consolas; font-size:10.5pt">DELETE</span><span style="font-family:微软雅黑; font-size:10.5pt">（</span><span style="font-family:Consolas; font-size:10.5pt">DELETE</span><span style="font-family:微软雅黑; font-size:10.5pt">）：从服务器删除资源。</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><span style="font-family:微软雅黑; font-size:10.5pt">还有两个不常用的</span><span style="font-family:Consolas; font-size:10.5pt">HTTP</span><span style="font-family:微软雅黑; font-size:10.5pt">动词。</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt 21pt; orphans:0; text-align:justify; text-indent:-21pt; widows:0"><span style="font-family:Wingdings; font-size:10.5pt"></span><span style="font:7.0pt 'Times New Roman'">&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0; </span><span style="font-family:Consolas; font-size:10.5pt">HEAD</span><span style="font-family:微软雅黑; font-size:10.5pt">：获取资源的元数据。</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt 21pt; orphans:0; text-align:justify; text-indent:-21pt; widows:0"><span style="font-family:Wingdings; font-size:10.5pt"></span><span style="font:7.0pt 'Times New Roman'">&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0; </span><span style="font-family:Consolas; font-size:10.5pt">OPTIONS</span><span style="font-family:微软雅黑; font-size:10.5pt">：获取信息，关于资源的哪些属性是客户端可以改变的。</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><span style="font-family:微软雅黑; font-size:10.5pt">下面是一些例子。</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt 21pt; orphans:0; text-align:justify; text-indent:-21pt; widows:0"><span style="font-family:Wingdings; font-size:10.5pt"></span><span style="font:7.0pt 'Times New Roman'">&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0; </span><span style="font-family:Consolas; font-size:10.5pt">GET /</span><span style="font-family:Consolas; font-size:10.5pt; vertical-align:baseline">academies</span><span style="font-family:微软雅黑; font-size:10.5pt">：列出所有学院</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt 21pt; orphans:0; text-align:justify; text-indent:-21pt; widows:0"><span style="font-family:Wingdings; font-size:10.5pt"></span><span style="font:7.0pt 'Times New Roman'">&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0; </span><span style="font-family:Consolas; font-size:10.5pt">POST /</span><span style="font-family:Consolas; font-size:10.5pt; vertical-align:baseline">academies</span><span style="font-family:微软雅黑; font-size:10.5pt">：新建一个学院</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt 21pt; orphans:0; text-align:justify; text-indent:-21pt; widows:0"><span style="font-family:Wingdings; font-size:10.5pt"></span><span style="font:7.0pt 'Times New Roman'">&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0; </span><span style="font-family:Consolas; font-size:10.5pt">GET /</span><span style="font-family:Consolas; font-size:10.5pt; vertical-align:baseline">academies</span><span style="font-family:Consolas; font-size:10.5pt">/ID</span><span style="font-family:微软雅黑; font-size:10.5pt">：获取某个指定学院的信息</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt 21pt; orphans:0; text-align:justify; text-indent:-21pt; widows:0"><span style="font-family:Wingdings; font-size:10.5pt"></span><span style="font:7.0pt 'Times New Roman'">&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0; </span><span style="font-family:Consolas; font-size:10.5pt">PUT /</span><span style="font-family:Consolas; font-size:10.5pt; vertical-align:baseline">academies</span><span style="font-family:Consolas; font-size:10.5pt">/ID</span><span style="font-family:微软雅黑; font-size:10.5pt">：更新某个指定学院的信息（提供该学院的全部信息）</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt 21pt; orphans:0; text-align:justify; text-indent:-21pt; widows:0"><span style="font-family:Wingdings; font-size:10.5pt"></span><span style="font:7.0pt 'Times New Roman'">&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0; </span><span style="font-family:Consolas; font-size:10.5pt">PATCH /</span><span style="font-family:Consolas; font-size:10.5pt; vertical-align:baseline">academies</span><span style="font-family:Consolas; font-size:10.5pt">/ID</span><span style="font-family:微软雅黑; font-size:10.5pt">：更新某个指定学院的信息（提供该学院的部分信息）</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt 21pt; orphans:0; text-align:justify; text-indent:-21pt; widows:0"><span style="font-family:Wingdings; font-size:10.5pt"></span><span style="font:7.0pt 'Times New Roman'">&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0; </span><span style="font-family:Consolas; font-size:10.5pt">DELETE /</span><span style="font-family:Consolas; font-size:10.5pt; vertical-align:baseline">academies</span><span style="font-family:Consolas; font-size:10.5pt">/ID</span><span style="font-family:微软雅黑; font-size:10.5pt">：删除某个学院</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt 21pt; orphans:0; text-align:justify; text-indent:-21pt; widows:0"><span style="font-family:Wingdings; font-size:10.5pt"></span><span style="font:7.0pt 'Times New Roman'">&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0; </span><span style="font-family:Consolas; font-size:10.5pt">GET /</span><span style="font-family:Consolas; font-size:10.5pt; vertical-align:baseline">academies</span><span style="font-family:Consolas; font-size:10.5pt">/ID/students</span><span style="font-family:微软雅黑; font-size:10.5pt">：列出某个指定学院下的所有学员</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt 21pt; orphans:0; text-align:justify; text-indent:-21pt; widows:0"><span style="font-family:Wingdings; font-size:10.5pt"></span><span style="font:7.0pt 'Times New Roman'">&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0; </span><span style="font-family:Consolas; font-size:10.5pt">DELETE /</span><span style="font-family:Consolas; font-size:10.5pt; vertical-align:baseline">academies</span><span style="font-family:Consolas; font-size:10.5pt">/ID/students/ID</span><span style="font-family:微软雅黑; font-size:10.5pt">：删除某个指定学院的指定学员</span></p><h3 style="margin:13pt 0pt; orphans:0; page-break-after:avoid; page-break-inside:avoid; text-align:justify; widows:0"><span style="font-family:Consolas; font-size:16pt; font-weight:bold">1.2.6 </span><span style="font-family:微软雅黑; font-size:16pt; font-weight:bold">过滤信息</span><span style="font-family:Consolas; font-size:16pt; font-weight:bold">(Filtering)</span></h3><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><span style="font-family:微软雅黑; font-size:10.5pt">如果记录数量很多，服务器不可能都将它们返回给用户。</span><span style="font-family:Consolas; font-size:10.5pt">API</span><span style="font-family:微软雅黑; font-size:10.5pt">应该提供参数，过滤返回结果。</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><span style="font-family:微软雅黑; font-size:10.5pt">下面是一些常见的参数</span><span style="font-family:Consolas; font-size:10.5pt">:</span></p><table cellspacing="0" cellpadding="0" style="border-collapse:collapse; margin-left:0pt"><tr><td style="border-bottom-color:#000000; border-bottom-style:solid; border-bottom-width:0.75pt; border-left-color:#000000; border-left-style:solid; border-left-width:0.75pt; border-right-color:#000000; border-right-style:solid; border-right-width:0.75pt; border-top-color:#000000; border-top-style:solid; border-top-width:0.75pt; padding-left:5.03pt; padding-right:5.03pt; vertical-align:top; width:415.3pt"><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; text-indent:21pt; widows:0"><span style="font-family:Consolas; font-size:10.5pt; vertical-align:baseline">?limit=10</span><span style="font-family:微软雅黑; font-size:10.5pt; vertical-align:baseline">：指定返回记录的数量</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; text-indent:21pt; widows:0"><span style="font-family:Consolas; font-size:10.5pt; vertical-align:baseline">?offset=10</span><span style="font-family:微软雅黑; font-size:10.5pt; vertical-align:baseline">：指定返回记录的开始位置。</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; text-indent:21pt; widows:0"><span style="font-family:Consolas; font-size:10.5pt; vertical-align:baseline">?page=2&amp;</span><span style="font-family:Consolas; font-size:10.5pt; vertical-align:baseline">num</span><span style="font-family:Consolas; font-size:10.5pt; vertical-align:baseline">=100</span><span style="font-family:微软雅黑; font-size:10.5pt; vertical-align:baseline">：指定第几页，以及每页的记录数。</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; text-indent:21pt; widows:0"><span style="font-family:Consolas; font-size:10.5pt; vertical-align:baseline">?sortby=name&amp;order=asc</span><span style="font-family:微软雅黑; font-size:10.5pt; vertical-align:baseline">：指定返回结果按照哪个属性排序，以及排序顺序。</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; text-indent:21pt; widows:0"><span style="font-family:Consolas; font-size:10.5pt; vertical-align:baseline">?</span><span style="font-family:Consolas; font-size:10.5pt">academy</span><span style="font-family:Consolas; font-size:10.5pt; vertical-align:baseline">_type_id=1</span><span style="font-family:微软雅黑; font-size:10.5pt; vertical-align:baseline">：指定筛选条件</span></p></td></tr></table><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; text-indent:21pt; widows:0"><span style="font-family:微软雅黑; font-size:10.5pt">参数的设计允许存在冗余，即允许</span><span style="font-family:Consolas; font-size:10.5pt">API</span><span style="font-family:微软雅黑; font-size:10.5pt">路径和</span><span style="font-family:Consolas; font-size:10.5pt">URL</span><span style="font-family:微软雅黑; font-size:10.5pt">参数偶尔有重复。比如，</span><span style="font-family:Consolas; font-size:10.5pt">GET /</span><span style="font-family:Consolas; font-size:10.5pt; vertical-align:baseline">academies</span><span style="font-family:Consolas; font-size:10.5pt">/ID/</span><span style="font-family:Consolas; font-size:10.5pt">students</span><span style="font-family:微软雅黑; font-size:10.5pt">与 </span><span style="font-family:Consolas; font-size:10.5pt">GET /</span><span style="font-family:Consolas; font-size:10.5pt">students</span><span style="font-family:Consolas; font-size:10.5pt">?</span><span style="font-family:Consolas; font-size:10.5pt; vertical-align:baseline">academy</span><span style="font-family:Consolas; font-size:10.5pt">_id=ID </span><span style="font-family:微软雅黑; font-size:10.5pt">的含义是相同的。</span></p><h3 style="margin:13pt 0pt; orphans:0; page-break-after:avoid; page-break-inside:avoid; text-align:justify; widows:0"><span style="font-family:Consolas; font-size:16pt; font-weight:bold">1.2.7 </span><span style="font-family:微软雅黑; font-size:16pt; font-weight:bold">状态码（</span><span style="font-family:Consolas; font-size:16pt; font-weight:bold">Status Codes</span><span style="font-family:微软雅黑; font-size:16pt; font-weight:bold">）</span></h3><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><span style="font-family:微软雅黑; font-size:10.5pt">服务器向用户返回的状态码和提示信息，常见的有以下一些（方括号中是该状态码对应的</span><span style="font-family:Consolas; font-size:10.5pt">HTTP</span><span style="font-family:微软雅黑; font-size:10.5pt">动词）。</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt 21pt; orphans:0; text-align:justify; text-indent:-21pt; widows:0"><span style="font-family:Wingdings; font-size:10.5pt"></span><span style="font:7.0pt 'Times New Roman'">&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0; </span><span style="font-family:Consolas; font-size:10.5pt">200 OK - [GET]</span><span style="font-family:微软雅黑; font-size:10.5pt">：服务器成功返回用户请求的数据，该操作是幂等的（</span><span style="font-family:Consolas; font-size:10.5pt">Idempotent</span><span style="font-family:微软雅黑; font-size:10.5pt">）。</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt 21pt; orphans:0; text-align:justify; text-indent:-21pt; widows:0"><span style="font-family:Wingdings; font-size:10.5pt"></span><span style="font:7.0pt 'Times New Roman'">&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0; </span><span style="font-family:Consolas; font-size:10.5pt">201 CREATED - [POST/PUT/PATCH]</span><span style="font-family:微软雅黑; font-size:10.5pt">：用户新建或修改数据成功。</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt 21pt; orphans:0; text-align:justify; text-indent:-21pt; widows:0"><span style="font-family:Wingdings; font-size:10.5pt"></span><span style="font:7.0pt 'Times New Roman'">&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0; </span><span style="font-family:Consolas; font-size:10.5pt">202 Accepted - [*]</span><span style="font-family:微软雅黑; font-size:10.5pt">：表示一个请求已经进入后台排队（异步任务）</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt 21pt; orphans:0; text-align:justify; text-indent:-21pt; widows:0"><span style="font-family:Wingdings; font-size:10.5pt"></span><span style="font:7.0pt 'Times New Roman'">&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0; </span><span style="font-family:Consolas; font-size:10.5pt">204 NO CONTENT - [DELETE]</span><span style="font-family:微软雅黑; font-size:10.5pt">：用户删除数据成功。</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt 21pt; orphans:0; text-align:justify; text-indent:-21pt; widows:0"><span style="font-family:Wingdings; font-size:10.5pt"></span><span style="font:7.0pt 'Times New Roman'">&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0; </span><span style="font-family:Consolas; font-size:10.5pt">400 INVALID REQUEST - [POST/PUT/PATCH]</span><span style="font-family:微软雅黑; font-size:10.5pt">：用户发出的请求有错误，服务器没有进行新建或修改数据的操作，该操作是幂等的。</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt 21pt; orphans:0; text-align:justify; text-indent:-21pt; widows:0"><span style="font-family:Wingdings; font-size:10.5pt"></span><span style="font:7.0pt 'Times New Roman'">&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0; </span><span style="font-family:Consolas; font-size:10.5pt">401 Unauthorized - [*]</span><span style="font-family:微软雅黑; font-size:10.5pt">：表示用户没有权限（令牌、用户名、密码错误）。</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt 21pt; orphans:0; text-align:justify; text-indent:-21pt; widows:0"><span style="font-family:Wingdings; font-size:10.5pt"></span><span style="font:7.0pt 'Times New Roman'">&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0; </span><span style="font-family:Consolas; font-size:10.5pt">403 Forbidden - [*] </span><span style="font-family:微软雅黑; font-size:10.5pt">表示用户得到授权（与</span><span style="font-family:Consolas; font-size:10.5pt">401</span><span style="font-family:微软雅黑; font-size:10.5pt">错误相对），但是访问是被禁止的。</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt 21pt; orphans:0; text-align:justify; text-indent:-21pt; widows:0"><span style="font-family:Wingdings; font-size:10.5pt"></span><span style="font:7.0pt 'Times New Roman'">&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0; </span><span style="font-family:Consolas; font-size:10.5pt">404 NOT FOUND - [*]</span><span style="font-family:微软雅黑; font-size:10.5pt">：用户发出的请求针对的是不存在的记录，服务器没有进行操作，该操作是幂等的。</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt 21pt; orphans:0; text-align:justify; text-indent:-21pt; widows:0"><span style="font-family:Wingdings; font-size:10.5pt"></span><span style="font:7.0pt 'Times New Roman'">&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0; </span><span style="font-family:Consolas; font-size:10.5pt">406 Not Acceptable - [GET]</span><span style="font-family:微软雅黑; font-size:10.5pt">：用户请求的格式不可得（比如用户请求</span><span style="font-family:Consolas; font-size:10.5pt">JSON</span><span style="font-family:微软雅黑; font-size:10.5pt">格式，但是只有</span><span style="font-family:Consolas; font-size:10.5pt">XML</span><span style="font-family:微软雅黑; font-size:10.5pt">格式）。</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt 21pt; orphans:0; text-align:justify; text-indent:-21pt; widows:0"><span style="font-family:Wingdings; font-size:10.5pt"></span><span style="font:7.0pt 'Times New Roman'">&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0; </span><span style="font-family:Consolas; font-size:10.5pt">410 Gone -[GET]</span><span style="font-family:微软雅黑; font-size:10.5pt">：用户请求的资源被永久删除，且不会再得到的。</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt 21pt; orphans:0; text-align:justify; text-indent:-21pt; widows:0"><span style="font-family:Wingdings; font-size:10.5pt"></span><span style="font:7.0pt 'Times New Roman'">&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0; </span><span style="font-family:Consolas; font-size:10.5pt">422 Unprocesable entity - [POST/PUT/PATCH] </span><span style="font-family:微软雅黑; font-size:10.5pt">当创建一个对象时，发生一个验证错误。</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt 21pt; orphans:0; text-align:justify; text-indent:-21pt; widows:0"><span style="font-family:Wingdings; font-size:10.5pt"></span><span style="font:7.0pt 'Times New Roman'">&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0; </span><span style="font-family:Consolas; font-size:10.5pt">500 INTERNAL SERVER ERROR - [*]</span><span style="font-family:微软雅黑; font-size:10.5pt">：服务器发生错误，用户将无法判断发出的请求是否成功。</span></p><h3 style="margin:13pt 0pt; orphans:0; page-break-after:avoid; page-break-inside:avoid; text-align:justify; widows:0"><span style="font-family:Consolas; font-size:16pt; font-weight:bold">1.2.8 </span><span style="font-family:微软雅黑; font-size:16pt; font-weight:bold">错误处理（</span><span style="font-family:Consolas; font-size:16pt; font-weight:bold">Error handling</span><span style="font-family:微软雅黑; font-size:16pt; font-weight:bold">）</span></h3><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><span style="font-family:微软雅黑; font-size:10.5pt">如果状态码是</span><span style="font-family:Consolas; font-size:10.5pt">4xx</span><span style="font-family:Consolas; font-size:10.5pt">/5xx</span><span style="font-family:微软雅黑; font-size:10.5pt">，就应该向用户返回出错信息。一般来说，返回的信息中将</span><span style="font-family:Consolas; font-size:10.5pt">error</span><span style="font-family:微软雅黑; font-size:10.5pt">作为键名，出错信息作为键值即可。</span></p><table cellspacing="0" cellpadding="0" style="border-collapse:collapse; margin-left:0pt"><tr><td style="border-bottom-color:#000000; border-bottom-style:solid; border-bottom-width:0.75pt; border-left-color:#000000; border-left-style:solid; border-left-width:0.75pt; border-right-color:#000000; border-right-style:solid; border-right-width:0.75pt; border-top-color:#000000; border-top-style:solid; border-top-width:0.75pt; padding-left:5.03pt; padding-right:5.03pt; vertical-align:top; width:415.3pt"><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><span style="font-family:Consolas; font-size:10.5pt; vertical-align:baseline">{</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; text-indent:21pt; widows:0"><span style="font-family:Consolas; font-size:10.5pt; vertical-align:baseline">    "error": "</span><span style="font-family:Consolas; font-size:10.5pt; vertical-align:baseline">error message</span><span style="font-family:Consolas; font-size:10.5pt; vertical-align:baseline">"</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><span style="font-family:Consolas; font-size:10.5pt; vertical-align:baseline">}</span></p></td></tr></table><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; text-indent:21pt; widows:0"><span style="font-family:Consolas; font-size:10.5pt">&#xa0;</span></p><h3 style="margin:13pt 0pt; orphans:0; page-break-after:avoid; page-break-inside:avoid; text-align:justify; widows:0"><span style="font-family:Consolas; font-size:16pt; font-weight:bold">1.2.9 </span><span style="font-family:微软雅黑; font-size:16pt; font-weight:bold">返回结果</span></h3><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><span style="font-family:微软雅黑; font-size:10.5pt">针对不同操作，服务器向用户返回的结果应该符合以下规范。</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt 21pt; orphans:0; text-align:justify; text-indent:-21pt; widows:0"><span style="font-family:Wingdings; font-size:10.5pt"></span><span style="font:7.0pt 'Times New Roman'">&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0; </span><span style="font-family:Consolas; font-size:10.5pt">GET /collection</span><span style="font-family:微软雅黑; font-size:10.5pt">：返回资源对象的列表（数组）</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt 21pt; orphans:0; text-align:justify; text-indent:-21pt; widows:0"><span style="font-family:Wingdings; font-size:10.5pt"></span><span style="font:7.0pt 'Times New Roman'">&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0; </span><span style="font-family:Consolas; font-size:10.5pt">GET /collection/resource</span><span style="font-family:微软雅黑; font-size:10.5pt">：返回单个资源对象</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt 21pt; orphans:0; text-align:justify; text-indent:-21pt; widows:0"><span style="font-family:Wingdings; font-size:10.5pt"></span><span style="font:7.0pt 'Times New Roman'">&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0; </span><span style="font-family:Consolas; font-size:10.5pt">POST /collection</span><span style="font-family:微软雅黑; font-size:10.5pt">：返回新生成的资源对象</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt 21pt; orphans:0; text-align:justify; text-indent:-21pt; widows:0"><span style="font-family:Wingdings; font-size:10.5pt"></span><span style="font:7.0pt 'Times New Roman'">&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0; </span><span style="font-family:Consolas; font-size:10.5pt">PUT /collection/resource</span><span style="font-family:微软雅黑; font-size:10.5pt">：返回完整的资源对象</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt 21pt; orphans:0; text-align:justify; text-indent:-21pt; widows:0"><span style="font-family:Wingdings; font-size:10.5pt"></span><span style="font:7.0pt 'Times New Roman'">&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0; </span><span style="font-family:Consolas; font-size:10.5pt">PATCH /collection/resource</span><span style="font-family:微软雅黑; font-size:10.5pt">：返回完整的资源对象</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt 21pt; orphans:0; text-align:justify; text-indent:-21pt; widows:0"><span style="font-family:Wingdings; font-size:10.5pt"></span><span style="font:7.0pt 'Times New Roman'">&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0; </span><span style="font-family:Consolas; font-size:10.5pt">DELETE /collection/resource</span><span style="font-family:微软雅黑; font-size:10.5pt">：返回一个空文档</span></p><h3 style="margin:13pt 0pt; orphans:0; page-break-after:avoid; page-break-inside:avoid; text-align:justify; widows:0"><span style="font-family:Consolas; font-size:16pt; font-weight:bold">1.2.10 </span><span style="font-family:微软雅黑; font-size:16pt; font-weight:bold">其他</span></h3><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><span style="font-family:微软雅黑; font-size:10.5pt">（</span><span style="font-family:Consolas; font-size:10.5pt">1</span><span style="font-family:微软雅黑; font-size:10.5pt">）</span><span style="font-family:Consolas; font-size:10.5pt">API</span><span style="font-family:微软雅黑; font-size:10.5pt">的身份认证应该使用</span><span style="font-family:Consolas; font-size:10.5pt">OAuth 2.0</span><span style="font-family:微软雅黑; font-size:10.5pt">框架。</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><span style="font-family:微软雅黑; font-size:10.5pt">（</span><span style="font-family:Consolas; font-size:10.5pt">2</span><span style="font-family:微软雅黑; font-size:10.5pt">）服务器返回的数据格式，应该尽量使用</span><span style="font-family:Consolas; font-size:10.5pt">JSON</span><span style="font-family:微软雅黑; font-size:10.5pt">，避免使用</span><span style="font-family:Consolas; font-size:10.5pt">XML</span><span style="font-family:微软雅黑; font-size:10.5pt">。</span></p><h1 style="font-size:22pt; line-height:130%; margin:13pt 0pt; orphans:0; page-break-after:avoid; page-break-inside:avoid; text-align:justify; text-indent:0pt; widows:0"><span style="font-family:Consolas; font-size:22pt; font-weight:bold">2</span><span style="font-family:微软雅黑; font-size:22pt; font-weight:bold">、</span><span style="font-family:Consolas; font-size:22pt; font-weight:bold">Swagger2</span><span style="font-family:微软雅黑; font-size:22pt; font-weight:bold">简介</span></h1><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><span style="font-family:Consolas; font-size:10.5pt">Swagger </span><span style="font-family:微软雅黑; font-size:10.5pt">是一套围绕 </span><span style="font-family:Consolas; font-size:10.5pt">OpenAPI </span><span style="font-family:微软雅黑; font-size:10.5pt">规范构建的开源工具，可以帮助您设计，构建，记录和使用 </span><span style="font-family:Consolas; font-size:10.5pt">REST API</span><span style="font-family:微软雅黑; font-size:10.5pt">。</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><span style="font-family:Consolas; font-size:10.5pt">Swagger </span><span style="font-family:微软雅黑; font-size:10.5pt">是一个规范和完整的框架，用于生成、描述、调用和可视化 </span><span style="font-family:Consolas; font-size:10.5pt">RESTful </span><span style="font-family:微软雅黑; font-size:10.5pt">风格的 </span><span style="font-family:Consolas; font-size:10.5pt">Web </span><span style="font-family:微软雅黑; font-size:10.5pt">服务。</span><span style="font-family:Consolas; font-size:10.5pt">Swagger </span><span style="font-family:微软雅黑; font-size:10.5pt">的目标是对 </span><span style="font-family:Consolas; font-size:10.5pt">REST API </span><span style="font-family:微软雅黑; font-size:10.5pt">定义一个标准的和语言无关的接口，可让人和计算机无需访问源码、文档或网络流量监测就可以发现和理解服务的能力。当通过 </span><span style="font-family:Consolas; font-size:10.5pt">Swagger </span><span style="font-family:微软雅黑; font-size:10.5pt">进行正确定义，用户可以理解远程服务并使用最少实现逻辑与远程服务进行交互。</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; text-indent:21pt; widows:0"><img src="4dc3a3b3-52ed-4895-998a-e1e4b7817890.001.png" width="550" height="270" alt="" style="-aw-left-pos:0pt; -aw-rel-hpos:column; -aw-rel-vpos:paragraph; -aw-top-pos:0pt; -aw-wrap-type:inline" /></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; text-indent:21pt; widows:0"><span style="font-family:微软雅黑; font-size:10.5pt">我们在项目中集成</span><span style="font-family:Consolas; font-size:10.5pt">Swagger</span><span style="font-family:微软雅黑; font-size:10.5pt">，编写项目的</span><span style="font-family:Consolas; font-size:10.5pt">swagger</span><span style="font-family:微软雅黑; font-size:10.5pt">注解后，项目就会生成一份</span><span style="font-family:Consolas; font-size:10.5pt">swagger</span><span style="font-family:微软雅黑; font-size:10.5pt">接口，但是我们将项目关闭后，前端就无法访问该文档了，因此，我们还需要给前端搭建一套</span><span style="font-family:Consolas; font-size:10.5pt">API</span><span style="font-family:微软雅黑; font-size:10.5pt">的接口展示服务，减少前端与后端的沟通成本。</span></p><h1 style="font-size:22pt; line-height:130%; margin:13pt 0pt; orphans:0; page-break-after:avoid; page-break-inside:avoid; text-align:justify; text-indent:0pt; widows:0"><span style="font-family:Consolas; font-size:22pt; font-weight:bold">3</span><span style="font-family:微软雅黑; font-size:22pt; font-weight:bold">、</span><span style="font-family:Consolas; font-size:22pt; font-weight:bold">YAPI </span><span style="font-family:微软雅黑; font-size:22pt; font-weight:bold">简介</span></h1><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><span style="font-family:Consolas; font-size:10.5pt">YApi </span><span style="font-family:微软雅黑; font-size:10.5pt">是高效、易用、功能强大的 </span><span style="font-family:Consolas; font-size:10.5pt">api </span><span style="font-family:微软雅黑; font-size:10.5pt">管理平台，旨在为开发、产品、测试人员提供更优雅的接口管理服务。可以帮助开发者轻松创建、发布、维护 </span><span style="font-family:Consolas; font-size:10.5pt">API</span><span style="font-family:微软雅黑; font-size:10.5pt">，</span><span style="font-family:Consolas; font-size:10.5pt">YApi </span><span style="font-family:微软雅黑; font-size:10.5pt">还为用户提供了优秀的交互体验，开发人员只需利用平台提供的接口数据写入工具以及简单的点击操作就可以实现接口的管理。</span></p><p style="font-size:16pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><span style="font-family:微软雅黑; font-size:16pt; font-weight:bold">特性</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt 21pt; orphans:0; text-align:justify; text-indent:-21pt; widows:0"><span style="font-family:Wingdings; font-size:10.5pt"></span><span style="font:7.0pt 'Times New Roman'">&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0; </span><span style="font-family:微软雅黑; font-size:10.5pt">基于 </span><span style="font-family:Consolas; font-size:10.5pt">Json5 </span><span style="font-family:微软雅黑; font-size:10.5pt">和 </span><span style="font-family:Consolas; font-size:10.5pt">Mockjs </span><span style="font-family:微软雅黑; font-size:10.5pt">定义接口返回数据的结构和文档，效率提升多倍</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt 21pt; orphans:0; text-align:justify; text-indent:-21pt; widows:0"><span style="font-family:Wingdings; font-size:10.5pt"></span><span style="font:7.0pt 'Times New Roman'">&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0; </span><span style="font-family:微软雅黑; font-size:10.5pt">扁平化权限设计，即保证了大型企业级项目的管理，又保证了易用性</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt 21pt; orphans:0; text-align:justify; text-indent:-21pt; widows:0"><span style="font-family:Wingdings; font-size:10.5pt"></span><span style="font:7.0pt 'Times New Roman'">&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0; </span><span style="font-family:微软雅黑; font-size:10.5pt">不仅有类似 </span><span style="font-family:Consolas; font-size:10.5pt">postman </span><span style="font-family:微软雅黑; font-size:10.5pt">的接口调试，还有强大的测试集功能</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt 21pt; orphans:0; text-align:justify; text-indent:-21pt; widows:0"><span style="font-family:Wingdings; font-size:10.5pt"></span><span style="font:7.0pt 'Times New Roman'">&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0; </span><span style="font-family:微软雅黑; font-size:10.5pt">免费开源，内网部署，信息再也不怕泄露了！</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt 21pt; orphans:0; text-align:justify; text-indent:-21pt; widows:0"><span style="font-family:Wingdings; font-size:10.5pt"></span><span style="font:7.0pt 'Times New Roman'">&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0; </span><span style="font-family:微软雅黑; font-size:10.5pt">支持 </span><span style="font-family:Consolas; font-size:10.5pt">postman, har, swagger </span><span style="font-family:微软雅黑; font-size:10.5pt">数据导入</span></p><h2 style="font-size:16pt; line-height:130%; margin:13pt 0pt; orphans:0; page-break-after:avoid; page-break-inside:avoid; text-align:justify; widows:0"><span style="font-family:Consolas; font-size:16pt; font-weight:bold">3.1 YApi</span><span style="font-family:微软雅黑; font-size:16pt; font-weight:bold">的私有云部署</span></h2><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><span style="font-family:微软雅黑; font-size:10.5pt">启动</span><span style="font-family:Consolas; font-size:10.5pt">YApi-mongo</span><span style="font-family:微软雅黑; font-size:10.5pt">：</span></p><table cellspacing="0" cellpadding="0" style="border-collapse:collapse; margin-left:0pt"><tr><td style="border-bottom-color:#000000; border-bottom-style:solid; border-bottom-width:0.75pt; border-left-color:#000000; border-left-style:solid; border-left-width:0.75pt; border-right-color:#000000; border-right-style:solid; border-right-width:0.75pt; border-top-color:#000000; border-top-style:solid; border-top-width:0.75pt; padding-left:5.03pt; padding-right:5.03pt; vertical-align:top; width:415.3pt"><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><span style="font-family:Consolas; font-size:10.5pt; vertical-align:baseline">docker run -d --name mongo-yapi mongo</span></p></td></tr></table><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><span style="font-family:微软雅黑; font-size:10.5pt">初始化</span><span style="font-family:Consolas; font-size:10.5pt">YApi</span><span style="font-family:微软雅黑; font-size:10.5pt">：</span></p><table cellspacing="0" cellpadding="0" style="border-collapse:collapse; margin-left:0pt"><tr><td style="border-bottom-color:#000000; border-bottom-style:solid; border-bottom-width:0.75pt; border-left-color:#000000; border-left-style:solid; border-left-width:0.75pt; border-right-color:#000000; border-right-style:solid; border-right-width:0.75pt; border-top-color:#000000; border-top-style:solid; border-top-width:0.75pt; padding-left:5.03pt; padding-right:5.03pt; vertical-align:top; width:415.3pt"><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><span style="font-family:Consolas; font-size:10.5pt; vertical-align:baseline">docker run -it --rm \</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; text-indent:21pt; widows:0"><span style="font-family:Consolas; font-size:10.5pt; vertical-align:baseline">--link mongo-yapi:mongo \</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; text-indent:21pt; widows:0"><span style="font-family:Consolas; font-size:10.5pt; vertical-align:baseline">--entrypoint npm \</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; text-indent:21pt; widows:0"><span style="font-family:Consolas; font-size:10.5pt; vertical-align:baseline">--workdir /api/vendors \</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; text-indent:21pt; widows:0"><span style="font-family:Consolas; font-size:10.5pt; vertical-align:baseline"> registry.cn-hangzhou.aliyuncs.com/anoy/yapi \</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; text-indent:21pt; widows:0"><span style="font-family:Consolas; font-size:10.5pt; vertical-align:baseline"> run install-server</span></p></td></tr></table><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><img src="4dc3a3b3-52ed-4895-998a-e1e4b7817890.002.png" width="554" height="298" alt="" style="-aw-left-pos:0pt; -aw-rel-hpos:column; -aw-rel-vpos:paragraph; -aw-top-pos:0pt; -aw-wrap-type:inline" /></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><span style="font-family:微软雅黑; font-size:10.5pt">启动</span><span style="font-family:Consolas; font-size:10.5pt">YApi</span><span style="font-family:微软雅黑; font-size:10.5pt">：</span></p><table cellspacing="0" cellpadding="0" style="border-collapse:collapse; margin-left:0pt"><tr><td style="border-bottom-color:#000000; border-bottom-style:solid; border-bottom-width:0.75pt; border-left-color:#000000; border-left-style:solid; border-left-width:0.75pt; border-right-color:#000000; border-right-style:solid; border-right-width:0.75pt; border-top-color:#000000; border-top-style:solid; border-top-width:0.75pt; padding-left:5.03pt; padding-right:5.03pt; vertical-align:top; width:415.3pt"><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><span style="font-family:Consolas; font-size:10.5pt; vertical-align:baseline">docker run -d \</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><span style="font-family:Consolas; font-size:10.5pt; vertical-align:baseline">  --name yapi \</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><span style="font-family:Consolas; font-size:10.5pt; vertical-align:baseline">  --link mongo-yapi:mongo \</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><span style="font-family:Consolas; font-size:10.5pt; vertical-align:baseline">  --workdir /api/vendors \</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><span style="font-family:Consolas; font-size:10.5pt; vertical-align:baseline">  -p 3000:3000 \</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><span style="font-family:Consolas; font-size:10.5pt; vertical-align:baseline">  registry.cn-hangzhou.aliyuncs.com/anoy/yapi \</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><span style="font-family:Consolas; font-size:10.5pt; vertical-align:baseline">  server/app.js</span></p></td></tr></table><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><span style="font-family:Consolas; font-size:10.5pt">&#xa0;</span></p><h2 style="font-size:16pt; line-height:130%; margin:13pt 0pt; orphans:0; page-break-after:avoid; page-break-inside:avoid; text-align:justify; widows:0"><span style="font-family:Consolas; font-size:16pt; font-weight:bold">3.2 YApi</span><span style="font-family:微软雅黑; font-size:16pt; font-weight:bold">的访问</span></h2><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><span style="font-family:微软雅黑; font-size:10.5pt">浏览器打开</span><span style="font-family:Consolas; font-size:10.5pt">:</span></p><table cellspacing="0" cellpadding="0" style="border-collapse:collapse; margin-left:0pt"><tr><td style="border-bottom-color:#000000; border-bottom-style:solid; border-bottom-width:0.75pt; border-left-color:#000000; border-left-style:solid; border-left-width:0.75pt; border-right-color:#000000; border-right-style:solid; border-right-width:0.75pt; border-top-color:#000000; border-top-style:solid; border-top-width:0.75pt; padding-left:5.03pt; padding-right:5.03pt; vertical-align:top; width:415.3pt"><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><span style="font-family:Consolas; font-size:10.5pt; vertical-align:baseline">http://</span><span style="font-family:微软雅黑; font-size:10.5pt; vertical-align:baseline">你的公网</span><span style="font-family:Consolas; font-size:10.5pt; vertical-align:baseline">ip</span><span style="font-family:Consolas; font-size:10.5pt; vertical-align:baseline">:3000/</span></p></td></tr></table><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><img src="4dc3a3b3-52ed-4895-998a-e1e4b7817890.003.png" width="554" height="252" alt="" style="-aw-left-pos:0pt; -aw-rel-hpos:column; -aw-rel-vpos:paragraph; -aw-top-pos:0pt; -aw-wrap-type:inline" /></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><span style="font-family:微软雅黑; font-size:10.5pt">可以选择直接使用默认的账号登录，或者是注册一个新的账号。</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><span style="font-family:微软雅黑; font-size:10.5pt">在这里我选择使用默认的账号登录：</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><span style="font-family:Consolas; font-size:10.5pt">&#xa0;</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><img src="4dc3a3b3-52ed-4895-998a-e1e4b7817890.004.png" width="554" height="450" alt="" style="-aw-left-pos:0pt; -aw-rel-hpos:column; -aw-rel-vpos:paragraph; -aw-top-pos:0pt; -aw-wrap-type:inline" /></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><img src="4dc3a3b3-52ed-4895-998a-e1e4b7817890.005.png" width="554" height="261" alt="" style="-aw-left-pos:0pt; -aw-rel-hpos:column; -aw-rel-vpos:paragraph; -aw-top-pos:0pt; -aw-wrap-type:inline" /></p><h2 style="font-size:16pt; line-height:130%; margin:13pt 0pt; orphans:0; page-break-after:avoid; page-break-inside:avoid; text-align:justify; widows:0"><span style="font-family:Consolas; font-size:16pt; font-weight:bold">3.3 CoinExchange</span><span style="font-family:微软雅黑; font-size:16pt; font-weight:bold">接口文档的导入</span></h2><h3 style="margin:13pt 0pt; orphans:0; page-break-after:avoid; page-break-inside:avoid; text-align:justify; widows:0"><span style="font-family:Consolas; font-size:16pt; font-weight:bold">3.3.1 CoinExchangeAdmin</span></h3><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><span style="font-family:微软雅黑; font-size:10.5pt">新建项目：</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><img src="4dc3a3b3-52ed-4895-998a-e1e4b7817890.006.png" width="553" height="223" alt="" style="-aw-left-pos:0pt; -aw-rel-hpos:column; -aw-rel-vpos:paragraph; -aw-top-pos:0pt; -aw-wrap-type:inline" /></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><span style="font-family:微软雅黑; font-size:10.5pt">导入数据：</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><img src="4dc3a3b3-52ed-4895-998a-e1e4b7817890.007.png" width="443" height="363" alt="" style="-aw-left-pos:0pt; -aw-rel-hpos:column; -aw-rel-vpos:paragraph; -aw-top-pos:0pt; -aw-wrap-type:inline" /></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><span style="font-family:微软雅黑; font-size:10.5pt">选择这个</span><span style="font-family:Consolas; font-size:10.5pt">:</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><img src="4dc3a3b3-52ed-4895-998a-e1e4b7817890.008.png" width="554" height="162" alt="" style="-aw-left-pos:0pt; -aw-rel-hpos:column; -aw-rel-vpos:paragraph; -aw-top-pos:0pt; -aw-wrap-type:inline" /></p><h3 style="margin:13pt 0pt; orphans:0; page-break-after:avoid; page-break-inside:avoid; text-align:justify; widows:0"><span style="font-family:Consolas; font-size:16pt; font-weight:bold">3.3.2 CoinExchangeUser</span></h3><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><span style="font-family:微软雅黑; font-size:10.5pt">新建项目</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><img src="4dc3a3b3-52ed-4895-998a-e1e4b7817890.009.png" width="410" height="209" alt="" style="-aw-left-pos:0pt; -aw-rel-hpos:column; -aw-rel-vpos:paragraph; -aw-top-pos:0pt; -aw-wrap-type:inline" /></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; text-indent:21pt; widows:0"><span style="font-family:Consolas; font-size:10.5pt">&#xa0;</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; text-indent:21pt; widows:0"><span style="font-family:微软雅黑; font-size:10.5pt">导入数据</span><span style="font-family:Consolas; font-size:10.5pt">:</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt 21pt; orphans:0; text-align:justify; text-indent:21pt; widows:0"><img src="4dc3a3b3-52ed-4895-998a-e1e4b7817890.010.png" width="554" height="467" alt="" style="-aw-left-pos:0pt; -aw-rel-hpos:column; -aw-rel-vpos:paragraph; -aw-top-pos:0pt; -aw-wrap-type:inline" /></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; text-indent:21pt; widows:0"><span style="font-family:微软雅黑; font-size:10.5pt">选择文件</span><span style="font-family:Consolas; font-size:10.5pt">:</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; text-indent:21pt; widows:0"><img src="4dc3a3b3-52ed-4895-998a-e1e4b7817890.011.png" width="554" height="150" alt="" style="-aw-left-pos:0pt; -aw-rel-hpos:column; -aw-rel-vpos:paragraph; -aw-top-pos:0pt; -aw-wrap-type:inline" /></p><h3 style="margin:13pt 0pt; orphans:0; page-break-after:avoid; page-break-inside:avoid; text-align:justify; widows:0"><span style="font-family:Consolas; font-size:16pt; font-weight:bold">3.3.3 CoinExchangeExchange</span></h3><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><span style="font-family:微软雅黑; font-size:10.5pt">新建项目</span><span style="font-family:Consolas; font-size:10.5pt">:</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:center; widows:0"><img src="4dc3a3b3-52ed-4895-998a-e1e4b7817890.012.png" width="469" height="288" alt="" style="-aw-left-pos:0pt; -aw-rel-hpos:column; -aw-rel-vpos:paragraph; -aw-top-pos:0pt; -aw-wrap-type:inline" /></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><span style="font-family:微软雅黑; font-size:10.5pt">导入数据</span><span style="font-family:Consolas; font-size:10.5pt">:</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><span style="font-family:Consolas; font-size:10.5pt"> </span><img src="4dc3a3b3-52ed-4895-998a-e1e4b7817890.013.png" width="456" height="384" alt="" style="-aw-left-pos:0pt; -aw-rel-hpos:column; -aw-rel-vpos:paragraph; -aw-top-pos:0pt; -aw-wrap-type:inline" /></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><span style="font-family:微软雅黑; font-size:10.5pt">选择文件</span><span style="font-family:Consolas; font-size:10.5pt">:</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; text-indent:21pt; widows:0"><img src="4dc3a3b3-52ed-4895-998a-e1e4b7817890.014.png" width="554" height="168" alt="" style="-aw-left-pos:0pt; -aw-rel-hpos:column; -aw-rel-vpos:paragraph; -aw-top-pos:0pt; -aw-wrap-type:inline" /></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt 21pt; orphans:0; text-align:justify; text-indent:21pt; widows:0"><span style="font-family:Consolas; font-size:10.5pt">&#xa0;</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><span style="font-family:Consolas; font-size:10.5pt">&#xa0;</span></p><p style="font-size:10.5pt; line-height:115%; margin:0pt 0pt 10pt; orphans:0; text-align:justify; widows:0"><span style="font-family:Consolas; font-size:10.5pt">&#xa0;</span></p></div><div class="cnzz" style="display: none;">
	        <script src="https://s23.cnzz.com/z_stat.php?id=1277655852&web_id=1277655852" language="JavaScript"></script>
            </div>
            <div class="docpe" style="position: absolute;color: white;margin-left:-450;">
            <a target="_blank" href="http://www.docpe.com">档铺网——在线文档免费处理</a>
            </div>
            </body></html>